<template>
  <el-form
    :model="modelForm"
    ref="modelForm"
    :loading="true"
    :disabled="!isEdit"
    :rules="isEdit ? formRule : {}"
    label-width="80px"
  >
    <el-row>
      <el-col :span="12">
        <el-form-item
          label="课时标题"
          prop="title"
        >
          <el-input
            v-model="modelForm.title"
            style="width: 80%"
            maxlength="30"
          />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item
          label="课时排序"
          style="width: 40%"
          prop="sort"
        >
          <el-input-number
            v-model="modelForm.sort"
            :min="0"
            :max="999"
          />
        </el-form-item>
      </el-col>
    </el-row>
    <el-form-item label="是否免费">
      <el-radio-group v-model="modelForm.free">
        <el-radio :label="true">免费</el-radio>
        <el-radio :label="false">默认</el-radio>
      </el-radio-group>
    </el-form-item>
  </el-form>
</template>
<script>
import { OneTableModelMixins } from '@/mixins/OneTableModelMixins'
export default {
  name: 'VideoModel',
  mixins: [OneTableModelMixins],
  props: {
    courseId: ''
  },
  data() {
    return {
      defaultModelForm: {
        sort: 0,
        free: false,
        courseId: this.courseId
      },
      formRule: {
        title: [{ required: true, message: '请填写教师资历', trigger: 'blur' },],
      }
    }
  },
}
</script>